﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Data.SqlClient;
using System.Data;

namespace VAdvantage.SqlExec
{
    public class ExecuteQuery
    {
        public static DataSet ExecuteDataset(string sql, SqlParameter[] param, string trx)
        {
            return DataBase.DB.ExecuteDataset(sql, param, trx);
        }
        public static DataSet ExecuteDataset(string sql, SqlParameter[] param)
        {
            return ExecuteDataset(sql, param, null);
        }

        public static DataSet ExecuteDataset(string sql)
        {
            return ExecuteDataset(sql, null, null);
        }

        public static string ExecuteScalar(string sql, SqlParameter[] param)
        {
            return ExecuteScalar(sql, param, null);
        }
        public static string ExecuteScalar(string sql)
        {
            return ExecuteScalar(sql, null, null);
        }

        public static string ExecuteScalar(string sql, SqlParameter[] param, string trxName)
        {
            return DataBase.DB.ExecuteScalar(sql, param, trxName).ToString();
        }

        public static int ExecuteNonQuery(string sql, SqlParameter[] param, String trxName)
        {
            return DataBase.DB.ExecuteQuery(sql, param, trxName);
        }
        public static int ExecuteNonQuery(string sql, SqlParameter[] param)
        {
            return ExecuteNonQuery(sql, param, null);
        }

        public static int ExecuteNonQuery(string sql)
        {
            return ExecuteNonQuery(sql, null, null);
        }
    }
}

namespace System.Windows.Forms
{
    class HAHA
    {
    }
}

namespace System.Drawing
{
    class HEHE
    {
    }
}
namespace System.Web.UI
{
    class HAHE
    {
    }
}
